<?php
/**
 * <pre>
 * <b>RUBIK IT Solution & Development ltd.</b>
 *
 * PROJECT		: HOTSWEETDATES
 * COPYRIGHT	: 2009
 * ------------------------------------------------------
 * 
 * [GENERAL INFO OF THIS FILE] 
 * 
 * </pre>
 * 
 * Created on	:  Mar 20, 2009
 * 
 * @author		minhvn <minhvn@rubik.com.vn>
 * @access		[public/private]
 * @package	[package name]
 *
 */

defined ( '_FW_EXEC' ) or die ( 'Restricted access' );

RCoreImporter::cls( "html.fieldInfo.FlashFileHtmlFieldInfo" );
RCoreImporter::cls( "html.fieldInfo.FlashAudioHtmlFieldInfo" );
RCoreImporter::cls( "html.fieldInfo.BasicFileHtmlFieldInfo" );
RCoreImporter::cls( "html.fieldInfo.FlashVideoHtmlFieldInfo" );

class PsdFileHtmlFieldInfo extends BasicFileHtmlFieldInfo  {
	/**
	 * Function for geting the html for previewing data
	 *
	 * @return string
	 */
	const ATTACH_ALLOWED_TYPES = '.jpg, .doc, .ppt, .swf, .zip, .rar, .pdf, .mp3, .wmv, .mp4, .mov, .mpg';
	
	function buildHtmlPreviewData($extAttributes = '', $key=null, $dataType ='S') {
		RCoreImporter::cls('helper.RFileFolderHelper');
		$ext = RFileFolderHelper::getFileExtention($this->_value);
		/*
		$ext = strtolower($ext);
		if ($ext == 'swf' || $ext == "jpg" || $ext == "gif" || $ext == "png") {
			$image = new FlashFileHtmlFieldInfo($this->_value);
			
			$image->setSupportedFilteType('.swf, .jpg, .gif, .png');
			return $image->buildHtmlPreviewData($extAttributes, $key, $dataType);
		}
		
		if ($ext == 'mp3' || $ext == 'wma') {
			$audio = new FlashAudioHtmlFieldInfo($this->getValue());
			$audio->setSupportedFilteType('.mp3, .wma');
			$audio->setPlayerType(FLASH_AUDIO_PLAYER_MINI_TYPE);
			return $audio->buildHtmlPreviewData($extAttributes, $key, $dataType);
		}
		*/
		return parent::buildHtmlPreviewData($extAttributes, $key, $dataType);
		
	}
}
?>